page_scdzqz = (state={},action)->
  switch action.type
    when 'SCDZQZ/GET_LIST_START'
      Object.assign {},state,{isLoading:true}
    when 'SCDZQZ/GET_LIST_COMPLETED'
      Object.assign {},state,
        list:state.list.concat(action.payload.list)
        isLoading:false
        pageIndex:if action.payload.list.length > 0 then state.pageIndex+1 else state.pageIndex
        completed:action.payload.list.length < 20
    when 'SCDZQZ/REFRESH_LIST_START'
      Object.assign {},state,{
        list:[]
        isLoading:false
        refreshing:true
      }
    when 'SCDZQZ/REFRESH_LIST_COMPLETED'
      Object.assign {},state,{
        list:action.payload.list
        isLoading:false
        pageIndex:1
        refreshing:false
        lastFetchTime:action.payload.lastFetchTime
        completed:action.payload.list.length<20
      }
    when 'SCDZQZ/MODIFY_LISTITEM'
      Object.assign {},state,{
        list:state.list.slice()
      }
    else
      state

module.exports = page_scdzqz
